package com.starmark.sys.org.atomic.mapper;

import com.starmark.core.framework.base.SuperMapper;
import com.starmark.sys.org.atomic.entity.SysOrgUserDeptRel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
  * 用户部门关系 Mapper 接口
 * </p>
 *
 * @author starmark
 * @since 2020-08-06
 */
@Mapper
public interface SysOrgUserDeptRelMapper extends SuperMapper<SysOrgUserDeptRel> {


    /**
     * 通过用户ID查找用户关系
     * @param userId  用户ID
     * @return 用户关系集合
     */
    @Select("select *  from sys_org_user_dept_rel where user_id=#{userId}  and  remove=0")
    @ResultMap("BaseResultMap")
    List<SysOrgUserDeptRel> findUserDeptRels(@Param("userId") String userId);
}